Ext.define('Triends.view.PostMain',{
	extend: 'Ext.Panel',
	xtype: 'postmain',
	id: 'postmain',
	config:{
		fullscreen: true,
    	layout: 'card',
    	showAnimation: 'slideIn',
    	listeners:{
    		initialize:function(){
    			var postStore = Ext.getStore('poststore');
		    				postStore.load();
    		}
    	},
    	items:[
    		{
				xtype: 'toolbar',
				docked: 'top',
				layout: 'hbox',
				height: '20%',
				items: [{
					xtype: 'segmentedbutton',
					width: '105%',
					style: 'margin-left:-2%',
					layout: 'hbox',
					items: [{
						text: '지역게시판',
						id: 'locationBtn1',
						flex: 1,
						handler: function(){
//		    				Triends.app.getHistory().add(Ext.create('Ext.app.Action', {
//		            			url: 'mainpage/post/postlocationlist'
//			        		}));
							var postlocationStore = Ext.getStore("postlocationstore");
		    				postlocationStore.load(); /* 원래 목록 뜰 수 있도록 */
							Ext.getCmp('postnormallist').hide();
							Ext.getCmp('postlocationlist').show();
		    				
						}
					},
					{
						text: '일반게시판',
						id: 'normalBtn1',
						pressed: true,
						flex: 1,
						handler:function(){
//		    				Triends.app.getHistory().add(Ext.create('Ext.app.Action', {
//		            			url: 'mainpage/post/postnormallist'
//			        		}));
							var postStore = Ext.getStore('poststore');
		    				postStore.load();
							Ext.getCmp('postlocationlist').hide();
							Ext.getCmp('postnormallist').show();
		    				
						}
					}]
				}]
			},
			{
				xtype: 'postnormallist'
			},
			{
				xtype: 'postlocationlist'
			}
    	]
	}
})